package com.example.group4.controller;

import com.example.group4.pojo.Teacher;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 周俊
 * @date 2021/8/9 22:16
 */
@RestController
public class TeacherController {

    /**
     * 打印一个用户信息
     */
    @GetMapping("/teacher")
    public Object getUser(){
        return new Teacher(1,"李四",24,'男',"成都","1304567890");
    }

    /**
     * 打印三个用户信息
     */
    @GetMapping("/teachers")
    public Object getUsers() {
        List<Teacher> list = new ArrayList<>();
        list.add(new Teacher(1,"李四",24,'男',"成都","1304567890"));
        list.add(new Teacher(2,"张三",28,'男',"成都","1203456743"));
        list.add(new Teacher(1,"五鬼",25,'女',"成都","1304650965"));
        return list;
    }
}
